The following example demonstrates how to retrieve the value of the ShipCountry and ShipCity properties of the current item and display them in TextBlocks located above the grid. Note that an item in a grid must be current in order for the information to be displayed.

XAML
Copy Code
<Grid xmlns:xcdg="http://schemas.xceed.com/wpf/xaml/datagrid">

  <Grid.Resources>

    <xcdg:DataGridCollectionViewSource x:Key="cvs_orders"

                                    Source="{Binding Source={x:Static Application.Current},

                                                      Path=Orders}"/>

   </Grid.Resources>

   <DockPanel>   

      <StackPanel Orientation="Horizontal" DockPanel.Dock="Top">

        <TextBlock Text="{Binding ElementName=OrdersGrid, Path=CurrentItem[ShipCountry]}"/>

        <TextBlock Text=" - "/> 

        <TextBlock Text="{Binding ElementName=OrdersGrid, Path=CurrentItem[ShipCity]}"/>

      </StackPanel>    

      <xcdg:DataGridControl x:Name="OrdersGrid"

                            ItemsSource="{Binding Source={StaticResource cvs_orders}}"

                            DockPanel.Dock="Bottom">

      </xcdg:DataGridControl>

   </DockPanel>

</Grid>